package com.wyyc.common.car.repository;

import com.wyyc.entity.MyCarEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Hwei~ on 2017/6/7.
 */
@Repository
@Transactional
public interface CarRepository extends PagingAndSortingRepository<MyCarEntity,Integer>,JpaRepository<MyCarEntity,Integer>{

    @Query("FROM MyCarEntity car where car.userId = ?1")
    List<MyCarEntity> findByUid(int uid);
}
